package test;


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt(); // 读取整数n
        int[] array = new int[n];

        // 读取n个整数并存储到数组中
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }

        long sum = 0; // 使用long类型以防止溢出

        // 计算两两相乘的和
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                sum += (long) array[i] * array[j];
            }
        }

        // 输出结果
        System.out.println(sum);

        scanner.close(); // 关闭scanner对象
    }
}
